import request, { post, get } from "@/utils/request";

// export function products(params) {
//     return request({
//       url: "/api/v1/products",  //接口路径
//       method: "get",  //接口方法
//       headers: { 'Content-Type': 'multipart/form-data' }, //给接口添加请求头
//       params  //接口参数
//     });
// }

//-------------------------------登陆---------------------------------------
// 登陆
export const login = (params) => post("/login",params)
//登出
export const logout = () => get("/login/logout")
//获取登陆用户信息
export const getUser = () => get("/user/getUserInfo")
//根据用户id获取用户信息
export const getUserById = (params) => get("/user/getUserById",params)
//注册
export const saveUser = (params) => post("/user/saveUser",params)
//获取邮箱验证码
export const getEmailReg = (params) => get("/user/getEmailReg",params)
//忘记密码
export const forgetPassword = (params) => post("/user/forgetPassword",params)
//修改密码
export const changePassword = (params) => post("/user/changePassword",params)
//更新用户
export const editUser = (params) => post("/user/editUser",params)
//获取学校列表
export const getFoodSchoolList = () => get("/school/getFoodSchoolList")
//获取美食类型
export const getFoodTypeList = () => get("/type/getFoodTypeList")
//根据学校获取餐厅
export const getFoodRestaurantBySchool = (params) => get("/restaurant/getFoodRestaurantBySchool",params)
//获取首页最多收藏
export const getFoodListByFavor = (params) => get("/list/getFoodListByFavor",params)
//获取首页最多浏览
export const getFoodListByLook = (params) => get("/list/getFoodListByLook",params)
//获取首页最多评论
export const getFoodListByComment = (params) => get("/list/getFoodListByComment",params)
//查询美食列表
export const getFoodListPage = (params) => post("/list/getFoodListPage",params)
//根据id查询美食
export const getFoodListById = (params) => get("/list/getFoodListById",params)
//保存收藏
export const saveFoodFavor = (params) => post("/favor/saveFoodFavor",params)
//查询收藏情况
export const getFoodFavorByListId = (params) => get("/favor/getFoodFavorByListId",params)
//删除FoodFavor
export const removeFoodFavor = (params) => get("/favor/removeFoodFavor",params)
//查询评论
export const getFoodCommentPage = (params) => post("/comment/getFoodCommentPage",params)
//保存评论
export const saveFoodComment = (params) => post("/comment/saveFoodComment",params)
//查询餐厅
export const getFoodRestaurantPage = (params) => post("/restaurant/getFoodRestaurantPage",params)
//根据id查询餐厅
export const getFoodRestaurantById = (params) => get("/restaurant/getFoodRestaurantById",params)
//根据餐厅查询分享
export const getFoodListByRestId = (params) => get("/list/getFoodListByRestId",params)
//查询收藏
export const getFoodFavorPage = (params) => post("/favor/getFoodFavorPage",params)
//根据id查询收藏
export const getFoodFavorById = (params) => get("/favor/getFoodFavorById",params)
//更新收藏
export const editFoodFavor = (params) => post("/favor/editFoodFavor",params)
//获取关于信息
export const getFoodRemarkByOne = () => get("/remark/getFoodRemarkByOne")
//删除FoodList
export const removeFoodList = (params) => get("/list/removeFoodList",params)
//保存美食
export const saveFoodList = (params) => post("/list/saveFoodList",params)
//更新美食
export const editFoodList = (params) => post("/list/editFoodList",params)
//增加浏览量
export const addLook = (params) => get("/list/addLook",params)